@extends('layout.admin')
@section("content")

    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <div class="panel-body">
            <form role="form" method="post" action="/admin/realnews/save">
                <div class="row">
                    <div class="col-md-2"><label class="control-label">新闻标题:</label></div>
                    <div class="col-md-4">
                        <input type="text" name="title" value="<?php echo isset($news->title)?$news->title:'';?>" class="form-control" placeholder="新闻标题">
                    </div>
                </div>
                <br/>
                <div class="row">
                    <div class="col-md-2"><label class="control-label">新闻内容:</label></div>
                    <div class="col-md-4">
                        <textarea class="textarea" name="content" id="content" placeholder="Enter text ..." style="width: 810px; height: 200px">
                            <?php echo isset($news['content'])?$news['content']:'';?>
                        </textarea>
                    </div>
                    <!-- 配置文件 -->
                    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
                    <!-- 编辑器源码文件 -->
                    <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
                    <!-- 实例化编辑器 -->
                    <script type="text/javascript">
                        var ue = UE.getEditor('content',{
                            toolbars:[[
                                'bold', 'italic', 'underline',
                                'lineheight', '|',
                                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
                                'simpleupload', 'emotion',
                            ]]
                        });
                    </script>
                </div>

                <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                <input type="hidden" name="id" value="<?php echo isset($news->id)?$news->id:0;?>">
                <div class="row" style="text-align: center;margin-top: 10px;">
                    <button type="submit" class="btn btn-primary btn-lg">保存</button>
                </div>
            </form>
        </div>
    </div>

@endsection